package com.kika.obwiki.utils;

import java.io.Serializable;

/**
 * 线程共享远程ip工具类
 */
public class RequestContext implements Serializable {
  private static final ThreadLocal<String> remoteAddr = new ThreadLocal<>();

  /**
   * 获取ip
   */
  public static String getRemoteAddr() {
    return remoteAddr.get();
  }

  /**
   * 存储远程ip字符串
   */
  public static void setRemoteAddr(String remoteAddrStr) {
    remoteAddr.set(remoteAddrStr);
  }
}